﻿//===================================================================================
// Microsoft patterns & practices
// Composite Application Guidance for Windows Presentation Foundation and Silverlight
//===================================================================================
// Copyright (c) Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===================================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===================================================================================
using System;

namespace Carcass.Events
{
  /// <summary>
  /// Generic arguments class to pass to event handlers that need to receive data.
  /// </summary>
  /// <typeparam name="TData">The type of data to pass.</typeparam>
  public class DataEventArgs<TData> : EventArgs
  {
    private readonly TData _value;

    /// <summary>
    /// Initializes the DataEventArgs class.
    /// </summary>
    /// <param name="value">Information related to the event.</param>
    public DataEventArgs(TData value)
    {
      _value = value;
    }

    /// <summary>
    /// Gets the information related to the event.
    /// </summary>
    /// <value>Information related to the event.</value>
    public TData Value
    {
      get { return _value; }
    }
  }
}
